#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#

# -*- mode: python; -*-

Import('BuildEnv')
env = BuildEnv.Clone()

env.Append(CPPPATH = [ env['TOP'] ])
env.Append(CPPPATH = [ env['TOP'] + '/db' ])
env.Append(CPPPATH = [ env['TOP'] + '/io' ])
env.Append(CPPPATH = [env['TOP'] + '/tools/sandesh/library/common'])

env.Append(LIBPATH = env['TOP'] + '/bgp/extended-community')
env.Append(LIBPATH = env['TOP'] + '/net')
env.Append(LIBPATH = env['TOP'] + '/schema')

env.Prepend(LIBS = ['gunit', 'extended_community', 'boost_regex', 'net',
                    'xmpp_unicast'])

default_gateway_test = env.UnitTest('default_gateway_test',
                                    ['default_gateway_test.cc'])
env.Alias('src/bgp/extended-community:default_gateway_test', default_gateway_test)

es_import_test = env.UnitTest('es_import_test',
                              ['es_import_test.cc'])
env.Alias('src/bgp/extended-community:es_import_test', es_import_test)

esi_label_test = env.UnitTest('esi_label_test',
                              ['esi_label_test.cc'])
env.Alias('src/bgp/extended-community:esi_label_test', esi_label_test)

mac_mobility_test = env.UnitTest('mac_mobility_test',
                                 ['mac_mobility_test.cc'])
env.Alias('src/bgp/extended-community:mac_mobility_test', mac_mobility_test)

router_mac_test = env.UnitTest('router_mac_test',
                               ['router_mac_test.cc'])
env.Alias('src/bgp/extended-community:router_mac_test', router_mac_test)

site_of_origin_test = env.UnitTest('site_of_origin_test',
                                   ['site_of_origin_test.cc'])
env.Alias('src/bgp/extended-community:site_of_origin_test', site_of_origin_test)

source_as_test = env.UnitTest('source_as_test',
                                   ['source_as_test.cc'])
env.Alias('src/bgp/extended-community:source_as_test', source_as_test)

vrf_route_import_test = env.UnitTest('vrf_route_import_test',
                                   ['vrf_route_import_test.cc'])
env.Alias('src/bgp/extended-community:vrf_route_import_test', vrf_route_import_test)

load_balance_test = env.UnitTest('load_balance_test',
                                   ['load_balance_test.cc'])
env.Alias('src/bgp/extended-community:load_balance_test', load_balance_test)

etree_test = env.UnitTest('etree_test',
                                   ['etree_test.cc'])
env.Alias('src/bgp/extended-community:etree_test', etree_test)

tag_test = env.UnitTest('tag_test', ['tag_test.cc'])
env.Alias('src/bgp/extended-community:tag_test', tag_test)

test_suite = [
    default_gateway_test,
    es_import_test,
    esi_label_test,
    etree_test,
    load_balance_test,
    mac_mobility_test,
    router_mac_test,
    site_of_origin_test,
    source_as_test,
    tag_test,
    vrf_route_import_test,
]

test = env.TestSuite('bgp-test', test_suite)
env.Alias('controller/src/bgp/extended-community:test', test)

Return('test_suite')
